package com.example.demo.controller;

import com.example.demo.service.Finddata;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@Controller
public class function {

    @Autowired
    Finddata finddata;

    @RequestMapping(value = "/query")
    public String query(Model model, String country)
    {

        System.out.println(country);
        finddata.findcountry(model,country);
        return "country_index";
    }

    @RequestMapping(value = "/list",method = RequestMethod.GET)
    public String list(Model model)
    {
        finddata.getAllRegionStats(model);
        return "index";
    }


}
